package ie.lawlor.amvc.patterns.main;

import ie.lawlor.amvc.IView;
import ie.lawlor.amvc.Triad;
import ie.lawlor.amvc.event.Event;

import javax.swing.SwingUtilities;


/**
 * @author blawlor
 *
 */
public class MainTriad extends Triad {
	
    public MainTriad(
        String name,
        MainModel model,
        IView view,
        MainController controller) {
        super(name, model, view, controller);
    }
    
    public MainTriad(){
    	super();
    }
    
    public void start(){
    SwingUtilities.invokeLater(
            new EventRunnable(new Event(controller.getEvent(MainController.MAINSTARTEVENT), 
            this)
            ));
    }
    
    public MainModel getMainModel(){
    	return (MainModel)model;
    }
    
    public void setMainModel(MainModel model){
    	this.model = model;
    }

    public IView getMainView(){
    	return view;
    }
    
    public void setMainView(IView view){
    	this.view = view;
    }

    public MainController getMainController(){
    	return (MainController)controller;
    }
    
    public void setMainController(MainController controller){
    	this.controller = controller;
    }

}
